/*******************************************************************************
 * Size: 10 px
 * Bpp: 4
 * Opts: --bpp 4 --size 10 --no-compress --font arialbd.ttf --symbols 1234567890 ENWS°′″. --format lvgl -o lv_font_arial_bold_10.c
 ******************************************************************************/
#define LV_LVGL_H_INCLUDE_SIMPLE
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

#ifndef LV_FONT_ARIAL_BOLD_10
#define LV_FONT_ARIAL_BOLD_10 1
#endif

#if LV_FONT_ARIAL_BOLD_10

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+0020 " " */

    /* U+002E "." */
    0x14, 0x4, 0xf1,

    /* U+0030 "0" */
    0x9, 0xfd, 0x20, 0x4f, 0x4a, 0xc0, 0x8e, 0x6,
    0xf0, 0x9d, 0x5, 0xf0, 0x8e, 0x6, 0xf0, 0x4f,
    0x3b, 0xc0, 0x8, 0xfd, 0x20,

    /* U+0031 "1" */
    0x0, 0x7f, 0x9, 0xff, 0x3a, 0x8f, 0x0, 0x7f,
    0x0, 0x7f, 0x0, 0x7f, 0x0, 0x7f,

    /* U+0032 "2" */
    0xa, 0xfe, 0x50, 0x7e, 0x29, 0xf0, 0x1, 0x7,
    0xf0, 0x0, 0x4f, 0x70, 0x4, 0xf9, 0x0, 0x2f,
    0xb3, 0x30, 0xaf, 0xff, 0xf1,

    /* U+0033 "3" */
    0x9, 0xfc, 0x20, 0x5e, 0x2c, 0xb0, 0x1, 0xc,
    0xa0, 0x0, 0xcf, 0x40, 0x0, 0x7, 0xf0, 0x6d,
    0x28, 0xf0, 0xa, 0xfd, 0x40,

    /* U+0034 "4" */
    0x0, 0x2f, 0x70, 0x0, 0xdf, 0x70, 0xa, 0xae,
    0x70, 0x6d, 0xe, 0x70, 0xcf, 0xff, 0xf5, 0x22,
    0x2e, 0x80, 0x0, 0xe, 0x70,

    /* U+0035 "5" */
    0xc, 0xff, 0xf0, 0xf, 0x63, 0x30, 0x3f, 0xdd,
    0x50, 0x29, 0x38, 0xf1, 0x0, 0x2, 0xf3, 0x6f,
    0x27, 0xf1, 0xa, 0xfd, 0x40,

    /* U+0036 "6" */
    0x6, 0xee, 0x70, 0x3f, 0x45, 0x80, 0x7f, 0xce,
    0x50, 0x9f, 0x36, 0xf0, 0x8f, 0x2, 0xf2, 0x4f,
    0x56, 0xf0, 0x7, 0xee, 0x50,

    /* U+0037 "7" */
    0x9f, 0xff, 0xf1, 0x13, 0x3c, 0xa0, 0x0, 0x4e,
    0x10, 0x0, 0xc7, 0x0, 0x2, 0xf2, 0x0, 0x6,
    0xe0, 0x0, 0x8, 0xb0, 0x0,

    /* U+0038 "8" */
    0xa, 0xfd, 0x30, 0x5f, 0x2a, 0xc0, 0x2f, 0x19,
    0xc0, 0x1d, 0xff, 0x40, 0x8e, 0x38, 0xe0, 0x7e,
    0x27, 0xf0, 0xa, 0xfe, 0x50,

    /* U+0039 "9" */
    0xa, 0xfc, 0x20, 0x7e, 0x2c, 0xc0, 0xab, 0x7,
    0xf0, 0x7d, 0xa, 0xf1, 0xa, 0xec, 0xf0, 0x38,
    0x2a, 0xb0, 0x1c, 0xfb, 0x10,

    /* U+0045 "E" */
    0x4f, 0xff, 0xff, 0x4, 0xf4, 0x22, 0x20, 0x4f,
    0x20, 0x0, 0x4, 0xff, 0xff, 0xb0, 0x4f, 0x42,
    0x21, 0x4, 0xf4, 0x22, 0x20, 0x4f, 0xff, 0xff,
    0x20,

    /* U+004E "N" */
    0x4f, 0x70, 0xe, 0x64, 0xff, 0x20, 0xe6, 0x4f,
    0xeb, 0xe, 0x64, 0xf5, 0xf5, 0xe6, 0x4f, 0x19,
    0xef, 0x64, 0xf1, 0x1e, 0xf6, 0x4f, 0x10, 0x5f,
    0x60,

    /* U+0053 "S" */
    0x8, 0xef, 0xc3, 0x4, 0xf5, 0x2c, 0xd0, 0x3f,
    0xb5, 0x21, 0x0, 0x5c, 0xff, 0x70, 0x35, 0x1,
    0x9f, 0x16, 0xf6, 0x3a, 0xf1, 0x8, 0xef, 0xd5,
    0x0,

    /* U+0057 "W" */
    0xda, 0x3, 0xfc, 0x2, 0xf4, 0x9d, 0x8, 0xff,
    0x5, 0xf0, 0x5f, 0x1c, 0x9f, 0x49, 0xc0, 0x1f,
    0x5f, 0x4c, 0x8d, 0x80, 0xd, 0xdf, 0x8, 0xdf,
    0x40, 0x9, 0xfb, 0x4, 0xff, 0x10, 0x5, 0xf7,
    0x0, 0xfc, 0x0,

    /* U+00B0 "°" */
    0x2b, 0xb1, 0x85, 0x67, 0x2b, 0xb2,

    /* U+2032 "′" */
    0x2f, 0x54, 0xf1, 0x14, 0x0,

    /* U+2033 "″" */
    0x2f, 0x5f, 0x85, 0xf3, 0xf3, 0x24, 0x5, 0x0
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 44, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 0, .adv_w = 44, .box_w = 3, .box_h = 2, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 3, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 24, .adv_w = 89, .box_w = 4, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 38, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 59, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 80, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 101, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 122, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 143, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 164, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 185, .adv_w = 89, .box_w = 6, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 206, .adv_w = 107, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 231, .adv_w = 116, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 256, .adv_w = 107, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 281, .adv_w = 151, .box_w = 10, .box_h = 7, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 316, .adv_w = 64, .box_w = 4, .box_h = 3, .ofs_x = 0, .ofs_y = 4},
    {.bitmap_index = 322, .adv_w = 38, .box_w = 3, .box_h = 3, .ofs_x = 0, .ofs_y = 4},
    {.bitmap_index = 327, .adv_w = 77, .box_w = 5, .box_h = 3, .ofs_x = 0, .ofs_y = 4}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_0[] = {
    0x0, 0xe, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
    0x16, 0x17, 0x18, 0x19, 0x25, 0x2e, 0x33, 0x37,
    0x90, 0x2012, 0x2013
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 32, .range_length = 8212, .glyph_id_start = 1,
        .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 19, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};

/*-----------------
 *    KERNING
 *----------------*/


/*Pair left and right glyphs for kerning*/
static const uint8_t kern_pair_glyph_ids[] =
{
    4, 4,
    16, 2
};

/* Kerning between the respective left and right glyphs
 * 4.4 format which needs to scaled with `kern_scale`*/
static const int8_t kern_pair_values[] =
{
    -9, -9
};

/*Collect the kern pair's data in one place*/
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
{
    .glyph_ids = kern_pair_glyph_ids,
    .values = kern_pair_values,
    .pair_cnt = 2,
    .glyph_ids_size = 0
};

/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LVGL_VERSION_MAJOR == 8
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
#endif

#if LVGL_VERSION_MAJOR >= 8
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = &kern_pairs,
    .kern_scale = 16,
    .cmap_num = 1,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LVGL_VERSION_MAJOR == 8
    .cache = &cache
#endif
};



/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t lv_font_arial_bold_10 = {
#else
lv_font_t lv_font_arial_bold_10 = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 7,          /*The maximum line height required by the font*/
    .base_line = 0,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -1,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc,          /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
#if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9
    .fallback = NULL,
#endif
    .user_data = NULL,
};



#endif /*#if LV_FONT_ARIAL_BOLD_10*/

